import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path:'',
    redirect:'/index'
  },
  {
    path: '/login',
    component: ()=>import('../pages/login.vue')
  },
  {
    path: '/index',
    component: ()=>import('../pages/index.vue'),
    children:[
      {
        path:'/home',
        component:()=>import('../views/home.vue')
      },
      {
        path:'/menu',
        component:()=>import('../views/menu/menu.vue'),
        meta:{
          title:'菜单管理'
        }
      },
      {
        path:'/role',
        component:()=>import('../views/role/role.vue'),
        meta:{
          title:'角色管理'
        }
      },
      {
        path:'/user',
        component:()=>import('../views/user/user.vue'),
        meta:{
          title:'管理员管理'
        }
      }
    ]
  },
 
 
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
